#include "core\PickableObject.h"

unsigned char PickableObject::runningID[3] = {1, 0, 0};

PickableObject::PickableObject()
{
  m_colorID[0] = runningID[0];
  m_colorID[1] = runningID[1];
  m_colorID[2] = runningID[2];

  runningID[0]++;
  if(runningID[0] >= 255)
  {
    runningID[0] = 0;
    runningID[1]++;
    if(runningID[1] >= 255)
    {
      runningID[1] = 0;
      runningID[2]++;
    }
  }
}

unsigned char PickableObject::getColorID(int channel)
{
  return m_colorID[channel];
}

bool PickableObject::isID(unsigned char id[3])
{
  return (id[0] == m_colorID[0] && id[1] == m_colorID[1] && id[2] == m_colorID[2]);
}